#include "stdafx.h"
#include "NtD3DTexture9.h"
#include "NtApplication.h"

NtD3DTexture9::NtD3DTexture9(void)
: m_pTexture(NULL)
{
}

NtD3DTexture9::~NtD3DTexture9(void)
{
	Release();
}

void NtD3DTexture9::Release()
{
	NtRelease(m_pTexture);
}

void NtD3DTexture9::LoadTexture( const char* szTexture )
{
	HRESULT hr = S_FALSE;

	if (szTexture)
	{
		hr= D3DXCreateTextureFromFile( NtApplication::GetInstance()->GetDevice(),
			szTexture, &m_pTexture);
	}

	if (S_OK != hr)
	{
		D3DXCreateTextureFromFile( NtApplication::GetInstance()->GetDevice(),
			"error.dds", &m_pTexture);
	}
}
